package com.wx.daoImpl;

import java.sql.Connection;
import java.sql.PreparedStatement;

import com.wx.dao.OrderCheckDao;
import com.wx.model.Users;
import com.wx.util.DBUtil;

public class OrderCheckDaoImpl implements OrderCheckDao {

	@Override
	public void updateUser(Users user) throws Exception {
		Connection connection = DBUtil.getConnection();
		PreparedStatement ps = connection.prepareStatement("update users set truename=?,phone=?,home=?,postcode=? where username=?");
		ps.setString(1,user.getTruename());
		ps.setString(2, user.getPhone());
		ps.setString(3,user.getHome());
		ps.setInt(4,user.getPostcode());
		ps.setString(5,user.getUsername());
		ps.executeUpdate();
		ps.close();
		connection.close();
	}

}
